package com.chengqj.observer.listener.event;

/**
 * @program: pattern
 * @description: 监听事件的目标源
 * @author: chengqj
 * @create: 2018-08-03 11:02
 **/
public class Subject extends EventListener{
    //通常的话，采用动态里来实现监控，避免了代码侵入
    public void add(){
        System.out.println("调用添加的方法");
        trigger(SubjectEventType.ON_ADD);
    }

    public void remove(){
        System.out.println("调用删除的方法");
        trigger(SubjectEventType.ON_RMOVE);
    }
}
